#ifndef __LB_CLIENT_H__
#define __LB_CLIENT_H__

#include <memory>

namespace dsth {
class EventLoop;
class InetSocketAddress;
class Connection;
class ChannelBuffer;
class Timestamp;
class ClientBootstrap;
class PBDispatcher;
class PBCodec;
class LBClient {
public:
    LBClient(EventLoop* loop, const InetSocketAddress& addr, const char* name);
    ~LBClient();
    void Run();
    void OnConnect(Connection* conn);
    void OnDisConnect(Connection* conn);
    void OnErrorMsg(Connection* conn, ChannelBuffer* buffer, Timestamp time);
private:
    LBClient(const LBClient&);
    void operator=(const LBClient&);

    std::auto_ptr<ClientBootstrap> client_;
    std::auto_ptr<PBDispatcher> dispatcher_;
    std::auto_ptr<PBCodec> codec_;
};

} // namespace
#endif // __LB_CLIENT_H__
